import request from '@/api/request.js'
const config = {
	global_isTest: false, // 是否是测试环境
	ApiVersion: "", // 版本号
	plat: '3', // 平台: 1安卓, 2ios, 3其他
	global_aeskey: "YHD6FCtZsqrmVXc2", // 通信秘钥
	host: "https://autodevice.onebity.com", // 基础域名
	global_baseddConnUrl: "https://autodevice.onebity.com/yw_api", //服务器接口路径
	uploadImg:'upload/upload',// 上传
};
export default config
// 接口示例
export function test(sendmsg){
	return request({
		method:"test",
		requestType:"GET",
		sendmsg
	})
}

// 小程序
/**
 * 获取openid
 * @param {Object} sendmsg
 */
export function getOpenId(sendmsg, isLoaing=false){
	return request({
		method:"WeChat/codeSession",
		requestType:"POST",
		sendmsg,
		isLoaing
	})
}

/**
 * 获取手机号
 * @param {Object} sendmsg
 */
export function getMobile(sendmsg, isLoaing=false){
	return request({
		method:"WeChat/decryptData",
		requestType:"POST",
		sendmsg,
		isLoaing
	})
}

/**
 * 微信登录
 * @param {Object} sendmsg
 */
export function wechatLogin(sendmsg, isLoaing=false){
	return request({
		method:"WeChat/login",
		requestType:"POST",
		sendmsg,
		isLoaing
	})
}

/**
 * 维修记录列表
 * @param {Object} sendmsg
 */
export function reportList(sendmsg, isLoaing=false){
	return request({
		method:"WeChat/ReportList",
		requestType:"GET",
		sendmsg,
		isLoaing
	})
}

/**
 * 维保提交
 * @param {Object} sendmsg
 */
export function submitReport(sendmsg, isLoaing=true){
	return request({
		method:"WeChat/submitReport",
		requestType:"POST",
		sendmsg,
		isLoaing
	})
}

// app
/**
 * 设备列表
 * @param {Object} sendmsg
 */
export function index(sendmsg, isLoaing=false){
	return request({
		method:"App/index",
		requestType:"GET",
		sendmsg,
		isLoaing
	})
}

/**
 * 获取设备类型
 * @param {Object} sendmsg
 */
export function gitEquipType(sendmsg, isLoaing=false){
	return request({
		method:"App/gitEquipType",
		requestType:"GET",
		sendmsg,
		isLoaing
	})
}

/**
 * 维保记录
 * @param {Object} sendmsg
 */
export function reportListForApp(sendmsg, isLoaing=false){
	return request({
		method:"App/ReportList",
		requestType:"GET",
		sendmsg,
		isLoaing
	})
}

/**
 * 提交预警
 * @param {Object} sendmsg
 */
export function updateStatus(sendmsg, isLoaing=true){
	return request({
		method:"App/updateStatus",
		requestType:"POST",
		sendmsg,
		isLoaing
	})
}

/**
 * 通知列表
 * @param {Object} sendmsg
 */
export function smsList(sendmsg, isLoaing=false){
	return request({
		method:"App/smsList",
		requestType:"GET",
		sendmsg,
		isLoaing
	})
}

/**
 * 登录
 * @param {Object} sendmsg
 */
export function login(sendmsg, isLoaing=false){
	return request({
		method:"WeChat/login",
		requestType:"POST",
		sendmsg,
		isLoaing
	})
}